#include<bits/stdc++.h>

using namespace std;
using ll=long long;
const int maxn = 1e6 + 100;
ll dp[maxn];//dp[8]=2
int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++)dp[i] = i;//
    dp[1] = dp[2] = dp[4] = dp[5] = dp[10] = 1;

    for (int i = 3; i <= n; i++) {
        if (i > 1)dp[i] = min(dp[i], dp[i - 1] + 1);
        if (i > 2)dp[i] = min(dp[i], dp[i - 2] + 1);
        if (i > 4)dp[i] = min(dp[i], dp[i - 4] + 1);
        if (i > 5)dp[i] = min(dp[i], dp[i - 5] + 1);
        if (i > 10)dp[i] = min(dp[i], dp[i - 10] + 1);
    }
    cout << dp[n];
    return 0;
}